# Maintainer: Anatol Pomozov

pkgname=aws-c-s3
pkgver=0.3.14
pkgrel=1
pkgdesc='C99 library implementation for communicating with the S3 service, designed for maximizing throughput on high bandwidth EC2 instances'
arch=(loong64 x86_64)
url='https://github.com/awslabs/aws-c-s3'
license=(Apache)
depends=(aws-c-common aws-c-auth aws-checksums)
makedepends=(cmake)
source=(aws-c-s3-$pkgver.zip::https://github.com/awslabs/aws-c-s3/archive/v$pkgver.zip)
sha256sums=('94052a4778afab9d9106ddfb2e5d61f99169c8bf50475bf9323fbe51550f2ad2')

build() {
  cd aws-c-s3-$pkgver

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -S . -B build
  cmake --build build
}

check() {
  cd aws-c-s3-$pkgver
  # A lot of tests failing
  # cmake --build build --target test
}

package() {
  cd aws-c-s3-$pkgver

  cmake --build build --target install -- DESTDIR="$pkgdir/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
